package com.starinside.wp.service.cookbook;


import com.starinside.wp.domain.cookbook.Recipe;
import org.joda.time.DateTime;

import java.util.List;
import java.util.Map;

public interface RecipeService {

	Recipe findByIdAndAreaId(Long id, String areaId);

    public List<Map<String, Object>> selectRecipeFoodByTime(Map<String, Object> params);
	/**
	 * 根据条件查询食谱
	 * @param  filter 中的参数如下
	 * @param schoolId 
	 * @param recipeTypeId 餐次类型id
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	
	public List<Recipe> selectRecipeListByCondition(Map<String, Object> filter);

	/**
	 * 根据学校Id查询最早的食谱日期
	 * @param areaId
	 * @return
	 */
	public String selectEarlyRecipeDateBySchoolId(String areaId);

	public int insertRecipeByRecipeList(List<Recipe> recipeList);

	public List<String> selectSchoolIdByTime(String startTime, String endTime);

	/**
	 * PC端删除餐次的时候 调用 同时删除该学校该餐次 当前时间之后的食谱
	 * @return
	 */
	public void deleteRecipeBySchoolAndTime(String areaId, String time, Long recipeTypeId);

	public void deleteById(Long id);
	public void deleteAll(List<Recipe> recipes);

	/**
	 * 根据条件查询食谱信息 zhangwei
	 * @param  filter 中的参数如下
     * @param areaId
     * @param recipeTypeId 餐次类型id
     * @param recipeDate
	 */
	public List<Map<String, Object>> selectRecipeFoodByFilter(Map<String, Object> params);

	/**
	 * 查询某日某校 配置了几个餐次(早餐 晚餐等) zhangwei
	 * @param recipeDate
	 * @param areaId
	 * @return
	 */
	public List<Map<String, Object>> selectRecipeTypeIdByTimeAndAreaId(String recipeDate, String areaId);

	/**
	 * 查询某学校 某段时间内的食谱
	 * @param startDate
	 * @param endDate
	 * @param areaId
	 * @return
	 */
	public List<Recipe> selectList(String startDate, String endDate, String areaId);

	int insertRecipeByRecipeList(List<Recipe> recipeList, List<DateTime> recipeDateList, String areaId);



}